from rest_framework import serializers
#
#
# class BookInfoSerializer(serializers.Serializer):
#    id = serializers.IntegerField(label='ID', read_only=True)
#    btitle = serializers.CharField(label='名称', max_length=20)
#    bpub_date = serializers.DateField(label='发布日期', required=False)
#    bread = serializers.IntegerField(label='阅读量', required=False, default=0)
#    bcomment = serializers.IntegerField(label='评论量', required=False, default=0)
#    image = serializers.ImageField(label='图片', required=False)
from books.models import BookInfo, HeroInfo


class BookModelSerializer(serializers.ModelSerializer):
   class Meta:
      model = BookInfo
      fields = '__all__'


class HeroModelSerializer(serializers.ModelSerializer):
   class Meta:
      model = HeroInfo
      fields = '__all__'
